package com.aletto.general_store.ui.activities;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import com.aletto.general_store.R;
import com.aletto.general_store.presenters.CommentGoodsPageTemplate;
import com.aletto.general_store.utils.XHelper;
import com.scwang.smart.refresh.layout.SmartRefreshLayout;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.RecyclerView;

/**
 * 评论列表
 */
public class GoodsCommentActivity extends AppCompatActivity {

    public static Intent newIntent(Context context, String id) {
        Intent intent = new Intent(context, GoodsCommentActivity.class);
        intent.putExtra("ID", id);
        return intent;
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_goods_comment);
        XHelper.initTitle(this, R.string.title_goods_comment);

        RecyclerView recyclerView = findViewById(com.sisyphus.spinach.R.id.recycler_view);
        SmartRefreshLayout refreshLayout = findViewById(com.sisyphus.spinach.R.id.refresh_layout);

        new CommentGoodsPageTemplate(
                recyclerView,
                refreshLayout,
                getIntent().getStringExtra("ID")
        ).execute(getLifecycle());
    }

}
